import random
from turtle import *
import tristone
import wave
import tree
import sky
import boat
from utils import absolute_move
def init():
    speed(0)
    delay(0)
    getscreen().colormode(255)
    setup(620,820)
    screensize(600,800)
#画布大小以及速度设置
init()
#元组存储背景树的颜色,通过randomcolor控制是否随机颜色
treeColors=((0, 160, 153),(60, 204, 132),(23, 130, 112))
def randomcolor():
        treeColors=((random.randint(1,255),random.randint(1,255),random.randint(1,255))\
            ,(random.randint(1,255),random.randint(1,255),random.randint(1,255))\
            ,(random.randint(1,255),random.randint(1,255),random.randint(1,255)))


#三潭印月实例化
tris=tristone.tristone(1)
#背景树实例化
tree=tree.tree()
#天空实例化
sky=sky.sky()
#设置树的颜色
tree.setcolor(treeColors)

absolute_move(-155,205)
sky.run()
absolute_move(-310,-10)
tree.run1()#背景树
#absolute_move(0,0)
wave.run()
absolute_move(-130,-303)
boat.run(1)
absolute_move(-320,-140)
boat.run(0.3)
#absolute_move(0,0)
tree.run2()#前景树
absolute_move(-20,-150)
tris.run(1)
absolute_move(150,-50)
tris.run(0.5)
absolute_move(-130,-30)
tris.run(0.3)
delay(5)
sky.move(80,10)
done()